package model;
import java.util.Observable;
import java.util.List;

import utils.Dom;

import org.jdom.Element;

public class Restaurant extends Observable{
	
	private Element restaurantInfos;
	
	public Restaurant(String str){
		String newStr = str.toLowerCase().replace(" ", "");
		restaurantInfos = Dom.getXMLFile("restaurants.xml").getRootElement().getChild(newStr);
	}
	
	public void setMenuSection(String str){
		String newStr = str.toLowerCase().replace(" ", "");
		List<Element> category = restaurantInfos.getChild("menu").getChild("categories").getChild(newStr).getChildren();
		setChanged();
		notifyObservers(category);
	}
}
